package net.stuffrepos.bricknetcenter.util.gui.inputcomponent;

import net.stuffrepos.bricknetcenter.util.gui.ScrolledTextArea;
import net.stuffrepos.bricknetcenter.util.gui.inputcomponent.InputComponentValueParser.ValueResult;

/**
 *
 * @author Eduardo H. Bogoni <eduardobogoni@gmail.com>
 */
public class ScrolledTextAreaStringParser implements InputComponentValueParser<ScrolledTextArea, String> {

    @Override
    public ValueResult<String> fromComponent(ScrolledTextArea component) {
        return new ValueResult<String>(component.getTextArea().getText(), true);
    }

    @Override
    public void toComponent(ScrolledTextArea component, String value) {
        component.getTextArea().setText(value);
    }

    @Override
    public void setEditable(ScrolledTextArea component, boolean editable) {
        component.getTextArea().setEditable(editable);
    }

}
